<template>
  <TransitionGroup name="fade" tag="ul">
    <li v-for="(item, index) in todos" :key="item.id">
      <span>{{ item.value }}</span> ---
      <button @click="del(index)">删除</button>
    </li>
  </TransitionGroup>
</template>

<script>
export default {
  props: ['todos'],
  methods: {
    del(index) {
      this.$emit('removeItem', index)
    }
  }
}
</script>

<style lang="scss" scoped></style>
